<template>
    <div ref="body">
        <Form :label-width="120" inline>
            <Form-item label="属地区划:">
                <area-linkage :areaCode.sync="param.ssca0043"></area-linkage>
            </Form-item>
            <Form-item label="人员姓名:">
                <Input v-model="param.azcp0003" placeholder="请输入户主姓名" style="width:200px"/>
            </Form-item>
            <Form-item label="户主身份证号码:">
                <Input v-model="param.azcp0001" placeholder="请输入户主身份证号码" style="width:200px"/>
            </Form-item>
            <Form-item label="家庭类别:">
                <c-dict-select v-model="param.azdf0503" dictCode="abaf0112code" :width="200"/>
            </Form-item>
            <Form-item label="申请类型:">
                <c-dict-select v-model="param.azdf0509" dictCode="abaf0110code" :width="200"/>
            </Form-item>
            <Form-item label="批准时间:">
                <DatePicker type="daterange" split-panels v-model="param.ssca0006_time"
                            placeholder="请选择批准时间" style="width: 200px"  :editable="false"></DatePicker>
            </Form-item>
            <Form-item label="救助类型:">
                <Select v-model="param.ssca0012" style="width: 200px">
                    <Option value="100">临时救助对象</Option>
                    <Option value="300">非救助对象</Option>
                </Select>
            </Form-item>
            <Form-item label="批准人区划级别:">
                <Select v-model="param.azaa0004" style="width: 200px">
                    <Option value="2">区县级</Option>
                    <Option value="3">乡镇街道级</Option>
                </Select>
            </Form-item>
            <Form-item label="受理人区划级别:">
                <Select v-model="param.dazaa0004" style="width: 200px">
                    <Option value="2">区县级</Option>
                    <Option value="3">乡镇街道级</Option>
                    <Option value="4">社区村级</Option>
                </Select>
            </Form-item>
            <Form-item label="是否本地户籍:">
                <c-dict-select v-model="param.azdf0505" dictCode="yesorno" :width="200"/>
            </Form-item>
            <Form-item label="联系人类型:">
                <c-dict-select v-model="param.azdf0510" dictCode="contact_type" :width="200"/>
            </Form-item>
            <Form-item label="联系人姓名:">
                <Input v-model="param.azdf0511" placeholder="请输入联系人姓名" style="width:200px"/>
            </Form-item>
            <Row class="button_row">
                 <span style="float: right;margin-right: 8px">
                 <Button type="primary" @click="searchQueryNew">查询</Button>
                 <Button type="primary" class="button_item_left" @click="searchResetNew">重置</Button>
                     </span>
            </Row>
        </Form>
        <div class="table_div">
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <vxe-table-column field="ssca0043" title="属地区划" align="center" min-width="220"
                                  :formatter="renderAreaName"/>
                <vxe-table-column field="azcp0003" title="户主姓名" align="center" min-width="100"/>
                <vxe-table-column field="azcp0001" title="身份证号码" align="center" min-width="200"/>
                <vxe-table-column field="azdf0505_name" title="是否本地户籍" align="center" min-width="150"/>
                <vxe-table-column field="azdf0503_name" title="家庭类别" align="center" min-width="150"/>
                <vxe-table-column field="azdf0509_name" title="申请类型" align="center" min-width="150"/>
                <vxe-table-column field="ssca0051" title="家庭人口" align="center" min-width="100"/>
                <vxe-table-column field="azdf0510_name" title="联系人类型" align="center" min-width="100"/>
                <vxe-table-column field="azdf0511" title="联系人姓名" align="center" min-width="100"/>
                <vxe-table-column field="azdf0010" title="联系电话" align="center" min-width="150"/>
                <vxe-table-column field="ssca0013_name" title="困难原因" align="center" min-width="150"/>
                <vxe-table-column field="ssca0006" title="批准时间" align="center" min-width="100" :formatter="renderTime"/>
                <vxe-table-column field="ssca0026" title="批准金额" align="center" min-width="100"/>
                <vxe-table-column field="ssca0009_name" title="开户银行" align="center" min-width="100"/>
                <vxe-table-column field="ssca0010" title="银行账户" align="center" min-width="100"/>
                <vxe-table-column field="ssca0011" title="银行账号" align="center" min-width="100"/>
                <vxe-table-column field="name" title="批准人" align="center" min-width="100"/>
                <vxe-table-column field="azaa0004" title="批准人区划级别" align="center" min-width="150"
                                  :formatter="areaLevel"/>
                <vxe-table-column field="azaa0002" title="批准人属地区划" align="center" min-width="200"/>
                <vxe-table-column title="操作" align="center" width="140" fixed="right">
                    <template #default="{row}">
                        <Button type="default" @click="detail(row)">查看详情</Button>
                    </template>
                </vxe-table-column>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>
        <application-his-modal ref="modalForm"/>
    </div>
</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import applicationHisModal from '../ls_application/applicationHisModal'

    export default {
        name: "history",
        mixins: [CommonMixin],
        components: {applicationHisModal},
        data() {
            return {
                param: {},
                queryParam: {},
                Loading: true,
                url: {
                    list: "/api/ac/subsistence/ss15301Service/page",
                },
            }
        },
        methods: {
            searchQueryNew() {
                this.queryParam = this.param;
                var time = this.param.ssca0006_time;
                if (time) {
                    if (time[0]) {
                        this.queryParam.ssca0006_begin = this.DateFormat(time[0], 'YYYY-MM-DD') + " 00:00:00";
                    } else {
                        this.queryParam.ssca0006_begin = null;
                    }
                    if (time[1]) {
                        this.queryParam.ssca0006_end = this.DateFormat(time[1], 'YYYY-MM-DD') + " 23:59:59";
                    } else {
                        this.queryParam.ssca0006_end = null;
                    }
                }
                this.loadData(1);
            },
            searchResetNew() {
                this.queryParam = {};
                this.param = {};
                this.loadData(1);
            },
            areaLevel(h) {
                if (h.cellValue == '2') {
                    return "区县级";
                } else if (h.cellValue == '3') {
                    return "乡镇街道级";
                }
            },
            detail: function (row) {
                var width = this.$refs.body.clientWidth;
                row.processinstid = row.ywgl004;
                this.$refs.modalForm.edit(row);
                this.$refs.modalForm.width = width + 40;
                this.$refs.modalForm.key = this.uuid();

            },
        },
        created() {
            this.findAreaList();
        }
    }
</script>

<style scoped>

</style>